
//
//  MBZYMCell.m
//  发布求租
//
//  Created by MB__Lee on 2018/6/9.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "MBZYMCell.h"

@interface MBZYMCell()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UILabel *xingLabel;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *unitLabel;

@property (weak, nonatomic) IBOutlet UITextField *titleText;

@end

@implementation MBZYMCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.xingLabel.hidden = YES;
    self.titleText.delegate = self;
    self.titleText.tintColor = MB_mainColor;
    // Initialization code
}

-(void)setCMModel:(MBCommonCellModel *)CMModel{
    [super setCMModel:CMModel];
    
    //是否隐藏 *
    if (self.CMModel.hasX) {
        self.xingLabel.hidden = NO;
    }else{
        self.xingLabel.hidden = YES;
    }
    
    self.nameLabel.text = self.CMModel.title;
    //单位
//    self.unitLabel.text = self.CMModel.unit;
    
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    
    [textField resignFirstResponder];
    return  YES;
}
-(void)textFieldDidEndEditing:(UITextField *)textField{
    self.CMModel.sourceUnit = textField.text;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}

@end
